﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using The_Square_Saga.Objects;
using The_Square_Saga.Utils;

namespace The_Square_Saga.Levels.Editor
{
    class LevelEditor
    {
        private Texture2D plataformImage;
        
        public LevelEditor(ContentManager content)
        {
            plataformImage = content.Load<Texture2D>("Images\\Scene\\plataform");
        }

        ///// <summary>
        ///// Construct the level using the TXT file
        ///// </summary>
        ///// <param name="numLevel">the number of a level -> for instance: level1.txt</param>
        ///// <returns></returns>
        //public Level constructLevel(int numLevel, Vector2 levelDimensions)
        //{
        //    Level level = new Level(1, levelDimensions);
        //    StreamReader sr = new StreamReader("./Content/Settings/level" + numLevel.ToString() + ".txt");

        //    // get line string
        //    string line = "";
        //    // count line
        //    int countLine = 0;
        //    int countCol = 0;
        //    int[,] collisionMatrix = new int[LevelConfig.ROWS,LevelConfig.COLS];
        //    while ((line = sr.ReadLine()) != null)
        //    {
        //        if (countLine >= LevelConfig.ROWS) break;

        //        string[] lineValues = line.Split(new char[] { ',' });
        //        for (int j = 0; j < lineValues.Length; j++)
        //        {
        //            if (lineValues[j].Length <= 0) continue;
                    
        //            collisionMatrix[countLine, countCol] = int.Parse(lineValues[j]);
        //            countCol++;
        //            if (countCol >= LevelConfig.COLS)
        //            {
        //                countCol = 0;
        //                countLine++;
        //            }
                    
        //        }
        //    }
        //    level.CollisionMatrix = collisionMatrix;
        //    return level;
        //}
    }
}
